{template '_header'}
<div class="page-heading">
    <h2>基础设置</h2>
</div>

<div class="alert alert-danger">警告：当模板中已经添加数据后切换自定义表单模板有可能导致无法使用！</div>

<form id="setform" action="" method="post" class="form-horizontal form-validate">

    <div class="form-group">
        <label class="col-sm-2 control-label">会员资料</label>



        <div class="col-sm-9 col-xs-12">

            {ifp 'diyform.set.edit'}
            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="0" name="setdata[user_diyform_open]" {if empty($set['user_diyform_open'])}checked{/if}> 关闭
            </label>
            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="1" name="setdata[user_diyform_open]" {if $set['user_diyform_open'] == 1}checked{/if}> 启用
            </label>


            <select id="user_diyform" name="setdata[user_diyform]" class="form-control" style="width:167px; float: left;margin-left:10px">
                <option value="0" {if $set['user_diyform']==0}selected{/if}>--选择自定义表单--</option>
                {loop $form_list $key $value}
                <option value="{$value['id']}" {if $set['user_diyform']==$value['id']}selected{/if}>{$value['title']}</option>
                {/loop}
            </select>
            {else}
            <div class="form-control-static">
                {if $set['user_diyform_open'] == 1}
                开启 -   {loop $form_list $key $value}{if $set['user_diyform']==$value['id']}{$value['title']}{/if}{/loop}
                {else}
                关闭
                {/if}
            </div>
            {/if}
        </div>


    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">分销商申请资料</label>


        <div class="col-sm-9 col-xs-12">
            {ifp 'diyform.set.edit'}

            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="0" name="setdata[commission_diyform_open]" {if empty($set['commission_diyform_open'])}checked{/if}> 关闭
            </label>
            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="1" name="setdata[commission_diyform_open]" {if $set['commission_diyform_open'] == 1}checked{/if}> 启用
            </label>


            <select id="commission_diyform" name="setdata[commission_diyform]" class="form-control" style="width:167px; float: left;margin-left:10px;">
                <option value="0" {if $set['commission_diyform']==0}selected{/if}>--选择自定义表单--</option>
                {loop $form_list $key $value}
                <option value="{$value['id']}" {if $set['commission_diyform']==$value['id']}selected{/if}>{$value['title']}</option>
                {/loop}
            </select>

            {else}
            <div class="form-control-static">
                {if $set['commission_diyform_open'] == 1}
                开启 -   {loop $form_list $key $value}{if $set['commission_diyform']==$value['id']}{$value['title']}{/if}{/loop}
                {else}
                关闭
                {/if}
            </div>
            {/if}
        </div>


    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">订单统一下单表单</label>


        <div class="col-sm-9 col-xs-12">
            {ifp 'diyform.set.edit'}
            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="0" name="setdata[order_diyform_open]" {if empty($set['order_diyform_open'])}checked{/if}> 关闭
            </label>
            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="1" name="setdata[order_diyform_open]" {if $set['order_diyform_open'] == 1}checked{/if}> 启用
            </label>

            <div>
            <select id="commission_diyform1" name="setdata[order_diyform]" class="form-control" style="width:167px; float: left;margin-left:10px;">
                <option value="0" {if $set['order_diyform']==0}selected{/if}>--选择自定义表单--</option>
                {loop $form_list $key $value}
                <option value="{$value['id']}" {if $set['order_diyform']==$value['id']}selected{/if}>{$value['title']}</option>
                {/loop}
            </select>
            </div>
            <div style="margin-left: 320px;">
            全局统一设置，购买任意产品，在确认订单页面都需要填写
            </div>
            {else}
            <div class="form-control-static">
                {if $set['order_diyform_open'] == 1}
                开启 -   {loop $form_list $key $value}{if $set['order_diyform']==$value['id']}{$value['title']}{/if}{/loop}
                {else}
                关闭
                {/if}
            </div>
            {/if}


        </div>


    </div>


{if p('globonus')}
    <div class="form-group">
        <label class="col-sm-2 control-label">股东申请资料</label>


        <div class="col-sm-9 col-xs-12">
            {ifp 'diyform.set.edit'}

            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="0" name="setdata[globonus_diyform_open]" {if empty($set['globonus_diyform_open'])}checked{/if}> 关闭
            </label>
            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="1" name="setdata[globonus_diyform_open]" {if $set['globonus_diyform_open'] == 1}checked{/if}> 启用
            </label>


            <select id="globonus_diyform" name="setdata[globonus_diyform]" class="form-control" style="width:167px; float: left;margin-left:10px;">
                <option value="0" {if $set['globonus_diyform']==0}selected{/if}>--选择自定义表单--</option>
                {loop $form_list $key $value}
                <option value="{$value['id']}" {if $set['globonus_diyform']==$value['id']}selected{/if}>{$value['title']}</option>
                {/loop}
            </select>

            {else}
            <div class="form-control-static">
                {if $set['globonus_diyform_open'] == 1}
                开启 -   {loop $form_list $key $value}{if $set['globonus_diyform']==$value['id']}{$value['title']}{/if}{/loop}
                {else}
                关闭
                {/if}
            </div>
            {/if}
        </div>


    </div>
{/if}



    {if p('abonus')}
    <div class="form-group">
        <label class="col-sm-2 control-label">区域代理申请资料</label>


        <div class="col-sm-9 col-xs-12">
            {ifp 'diyform.set.edit'}

            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="0" name="setdata[abonus_diyform_open]" {if empty($set['abonus_diyform_open'])}checked{/if}> 关闭
            </label>
            <label class="radio radio-inline" style="float: left;">
                <input type="radio" value="1" name="setdata[abonus_diyform_open]" {if $set['abonus_diyform_open'] == 1}checked{/if}> 启用
            </label>


            <select id="abonus_diyform" name="setdata[abonus_diyform]" class="form-control" style="width:167px; float: left;margin-left:10px;">
                <option value="0" {if $set['abonus_diyform']==0}selected{/if}>--选择自定义表单--</option>
                {loop $form_list $key $value}
                <option value="{$value['id']}" {if $set['abonus_diyform']==$value['id']}selected{/if}>{$value['title']}</option>
                {/loop}
            </select>

            {else}
            <div class="form-control-static">
                {if $set['abonus_diyform_open'] == 1}
                开启 -   {loop $form_list $key $value}{if $set['abonus_diyform']==$value['id']}{$value['title']}{/if}{/loop}
                {else}
                关闭
                {/if}
            </div>
            {/if}
        </div>


    </div>
    {/if}

    {ifp 'diyform.set.edit'}
    <div class="form-group">
        <label class="col-sm-2 control-label"></label>

        <div class="col-sm-9">
            <input type="submit"  value="提交" class="btn btn-primary"/>
        </div>
    </div>

    {/if}

</form>
{template '_footer'}